@var frontPath_tmp = isEmpty(frontPath)?"/":frontPath;
<!-- 放在north里就只能把内容限制在north里了，然而我需要菜单。。。 -->

<div class="blue">
	<div class="blue_header">
		<div class="blue_header_logo" onclick="goBackHome()">
			<div class="hospital_logo">
				<img height="40" width="40" src="/static/common/hospitalLogo/HospitalLogo.png">
			</div>
			<div class="company_logo">
				<img width="100" src="/static/common/img/iMedical-HO.png">
			</div>
			<div class="company_logo">${sysFullName!}</div>
		</div>
		<div class="blue_header_menu" id="blue_header_menu">

			<div class='lbtn' id="lbtnId"><i class='fa fa-angle-left fa-2x'></i></div>
			<div id="menuDiv">

			</div>
			<div class='rbtn' id="rbtnId"><i class='fa fa-angle-right fa-2x'></i></div>
		</div>
		<div class="blue_header_right">
			<!-- <div class="blue_beader_btns ">
				<a href="#" title="未读">
                   	<img alt="未读" src="/static/common/img/toRead.png">
				</a>
				<a href="javascript:Sys.addTabPage('通讯录', '${backendPath}/addresslist/info', true);" title="通讯录">
                     <img alt="通讯录" src="/static/common/img/tongxunlu.png">
				</a>
				<a href="#" title="IM">
					<img alt="IM" src="/static/common/img/im.png">
				</a>
				<a href="javascript:Sys.addTabPage('日历', '${backendPath}/oa/schedule', true);" title="日历">
					<img alt="日历" src="/static/common/img/rili.png">
				</a> 
				<div class="dropdown profile-element">
					<a data-toggle="dropdown" class="dropdown-toggle" href="#">
						<img alt="快捷" src="/static/common/img/kuaijie.png">
					</a>
					<ul id="shortcut_ul" class="dropdown-menu dropdown-menu-right">
						<li>
							<a style="width:100%" target="blank" href="${frontPath_tmp}">默认站点</a>
						</li>
					</ul>
				</div>
			</div> -->
			<!-- <div class="blue_header_separator"></div> -->
			<div class="blue_header_personal ">
				<div class="dropdown profile-element ">
					<a data-toggle="dropdown" class="dropdown-toggle blue_header_personal_name " href="#">
						<img  class="img-circle blue_header_personal_head"
							  @if(isEmpty(avatar)){
							  src="${ctxPath}/static/common/img/default.jpg"
							  @}else{
							  src="${ctxPath}/file/image/${avatar}"
							  @}
							  class="img-circle" style="width:30px;height:30px" alt="用户头像"/>
						<span class="clear">
							<span class="block m-t-xs"><strong class="font-bold">${shiro.getUser().name}</strong></span>
							<span class="text-xs block"><b class="caret"></b></span>
						</span>
					</a>
					<ul id="personal_div" role="menu" class="dropdown-menu animated dropdown-menu-right m-t-xs list-group">
						<li class="groupJob list-group-item active">
							当前身份：${shiro.getUser().name}
						</li>
						<li class="divider"></li>
						<li>
							<a href="javascript:Sys.addTabPage('个人信息', '${backendPath}/user/info', true);">个人资料</a>
						</li>
						<li>
							<a href="javascript:Sys.addTabPage('修改密码', '${backendPath}/user/to_password', true);">修改密码</a>
						</li>
						<li class="divider"></li>
						<li><a href="${backendPath}/logout">注销</a></li>
					</ul>
				</div>
			</div>
			<div class="blue_beader_logout">
				<a href="${backendPath}/logout" class="blue_header_logout " title="注销">
					<i class="fa fa-sign-in" aria-hidden="true" alt="注销"></i>
				</a>
			</div>
		</div>
	</div>
</div>
<script>
	//点击LOGO返回首页
	function goBackHome(){
		Sys.addTabPage("首页",Sys.backendPath+"/analysis/qcportal", true);
	}
	/*IE9+没问题 IE6\7\8菜单有问题  */
	var initmenu = function(dropdown, menudata) {
		//console.log("menudata:",menudata);
		//加载一级菜单
		function createNode(data) {
			$.each(data,function(entryIndex,entry){
				var div = $("<div class='dropdown' id='"+entry["id"]+"' style='float: left;'></div>");//一级菜单
				var _a = $("<a style='height:50px; width:100%; font-size:16px;line-height:30px; color:white;' role='button' data-toggle='dropdown' class='btn' data-target='#' href='javascript:;'>"+
						entry["text"]+"</a>");
				if(entry["iconCls"]!=null&&entry["iconCls"]!=''){
					var _img = "<i class='fa "+entry["iconCls"]+"'></i>";
					_a.prepend(_img);
				}
				_a.click(function(){
					if(entry["restype"]==2){//一级菜单下无菜单 点击跳转页面
						if($.trim(entry["url"])==$.trim("${backendPath}/logout")){
							window.location.href="${backendPath}/logout";
						}else{
							Sys.addTabPage(entry["text"],entry["url"], true);
						}
					}
				});
				div.append(_a);
				dropdown.append(div);
				//一级菜单下有子菜单
				if(entry["restype"]==1){
					_a.append("<span class='caret'></span>");//给一级菜单加上 下三角符号
					createChildNode($("#"+entry["id"]),entry["children"]);
				}


			});
		}

		//递归加载一级菜单下的子菜单  实现无限级菜单
		function createChildNode(element,data) {
			var _ul = $("<ul class='dropdown-menu'></ul>");
			if(data!=null&&data!=""){
				$.each(data,function(entryIndex,entry){
					if(entry["children"].length!=0) {
						var _li = $("<li class='dropdown-submenu'></li>");
						var c_a = $("<a href='javascript:;'>"+entry["text"]+"</a>");
						if(entry["iconCls"]!=null&&entry["iconCls"]!=''){
							var c_img = "<i class='fa "+entry["iconCls"]+"'></i>";
							c_a.prepend(c_img);
						}
						_li.append(c_a);
						createChildNode(_li,entry["children"]);//递归
						_ul.append(_li);

					} else {
						var _li = $("<li></li>");
						var c_a = $("<a href='javascript:;'>"+entry["text"]+"</a>");
						if(entry["iconCls"]!=null&&entry["iconCls"]!=''){
							var c_img = "<i class='fa "+entry["iconCls"]+"'></i>";
							c_a.prepend(c_img);
						}
						c_a.click(function(){
							if(entry["restype"]==2){
								if($.trim(entry["url"])==$.trim("${backendPath}/logout")){
									window.location.href="${backendPath}/logout";
								}else{
									Sys.addTabPage(entry["text"],entry["url"], true);
								}
							}
						});
						_li.append(c_a);
						_ul.append(_li);
					}
				});
			}
			element.append(_ul);
		}
		createNode(menudata);
	}

	var getKettleErrorLog = function () {
		var ajax = new $ax(Sys.backendPath + "/cdc/kettlejoblog/getErrorJobLog", function (data) {
			if (data.length > 0) {
				var oldOk = $.messager.defaults.ok;
				var oldNo = $.messager.defaults.no;
				$.messager.defaults.ok = "查看";
				$.messager.defaults.cancel = "稍后";
				var btns = $.messager.confirm("提示", "系统数据同步任务有失败记录，请及时联系单病种维护人员处理，避免影响上报工作！\n", function (r) {
					if (r) {
						Sys.openHtml("日志详细", "<pre>" +  data[0].logField + "</pre>", ['800px', '600px']);
						var logIds = [];
						data.forEach(function (entry) {
							logIds.push(entry.idJob);
						})
						var ajax = new $ax(Sys.backendPath + "/cdc/kettlejoblog/updateLogReadStatus");
						ajax.set("logIds", JSON.stringify(logIds))
						ajax.setAsync();
						ajax.start();
					} else {
						$.messager.popover({ msg: "下次登录再次提醒您", type: 'info'});
					}
				}).children("div.messager-button");
				btns.children("a:eq(1)").focus();
				btns.children("a:eq(0)").addClass('green'); //修改成green2943195
			}
		});
		ajax.setAsync();
		ajax.start();
	}
	var getDataReceiveErrorLog = function () {
		var ajax = new $ax(Sys.backendPath + "/cdc/cdcDataReceiveLog/getDataReceiveErrorLog", function (data) {
			if (data.length > 0) {
				$.messager.defaults.ok = "查看";
				$.messager.defaults.cancel = "稍后";
				var btns = $.messager.confirm("提示", "数据接收已失败"+data.length+"次，请及时联系单病种维护人员处理！\n", function (r) {
					if (r) {
						Sys.open("数据接受日志", "/cdc/cdcDataReceiveLog", ['1200px', '600px'], function(){
							var logIds = [];
							data.forEach(function (entry) {
								logIds.push(entry.id);
							})
							var ajax = new $ax(Sys.backendPath + "/cdc/cdcDataReceiveLog/updateDataReceiveLogReadStatus");
							ajax.set("logIds", JSON.stringify(logIds))
							ajax.setAsync();
							ajax.start();
						})
					} else {
						$.messager.popover({ msg: "下次登录再次提醒您", type: 'info'});
					}
				}).children("div.messager-button");
				btns.children("a:eq(1)").focus();
				btns.children("a:eq(0)").addClass('green'); //修改成green2943195
			}
		});
		ajax.setAsync();
		ajax.start();
	}
	$(function () {

		//初始化菜单
		initmenu($("#menuDiv"), ${menus});

		var m1 = document.getElementById("blue_header_menu");//中间菜单最大的DIV
		var bluewidth = m1.offsetWidth;//中间菜单最大的DIV 宽度
		var divwidth = 0;//记录所有头菜单总长度
		var showIndex = 0;//第一个显示的菜单下标
		var hideIndex = -1;//第一个隐藏的菜单下标

		//菜单是否超过长度 添加右箭头
		$("#menuDiv div").each(function(i,d){//循环每一个头菜单
			divwidth += $(this).width();
			if(divwidth>=bluewidth){//如果头菜单总长度 大于 中间菜单最大的DIV 宽度
				//$(".rbtn").show();//显示右边箭头
				// var rbtn = document.getElementById("rbtnId");
				// rbtn.style.display = "block";
				$('#rbtnId').show();
				m1.className+=" padding-lr-15";
				$(this).hide();//隐藏该菜单
				if(hideIndex==-1){
					hideIndex = i;
				}
			}
		});

		/**右箭头点击效果**/
		$(".rbtn").click(function(t){
			var md = $("#menuDiv div");
			var mdLen = md.length;//头菜单个数
			$(md[showIndex]).hide();
			showIndex += 1;//第一个显示的菜单下标+1
			$(md[hideIndex]).show();
			if(hideIndex<mdLen){//如果隐藏的菜单下标 小于最后一个菜单下标
				hideIndex +=1;
			}
			if(hideIndex==mdLen){//如果已到达最后一个菜单 隐藏右箭头
				$(".rbtn").hide();
			}
			$(".lbtn").show();
		});

		/**左箭头点击效果**/
		$(".lbtn").click(function(t){
			var md = $("#menuDiv div");
			var mdLen = md.length;//头菜单个数
			showIndex = showIndex - 1;//第一个显示的菜单下标-1
			$(md[showIndex]).show();
			if(showIndex == 0){//如果第一个显示的菜单是第一个菜单 那么隐藏左边箭头
				$(".lbtn").hide();
			}
			hideIndex = hideIndex - 1;
			$(md[hideIndex]).hide();
			$(".rbtn").show();
		});

		/**加载kettle错误日志**/
		getKettleErrorLog();
		/**加载过程质控数据接收错误日志**/
		getDataReceiveErrorLog();
	});
</script>
<div region='north' border='false' style="height:52px;"></div>
